﻿using System;
using System.Net;
using System.Runtime.Serialization;

namespace Airport
{
    [DataContract]
    public class Vehicle
    {

        private int _vehicleId;
        private Node _location;
        private VehicleType _type;

        public Vehicle()
            : this(-1, new Node(), new VehicleType())
        {
        }

        public Vehicle(int vehicleId, Node location, VehicleType type)
        {
            _vehicleId = vehicleId;
            _location = location;
            _type = type;
        }

        [DataMember]
        public int VehicleId
        {
            get
            {
                return _vehicleId;
            }

            set
            {
                if (_vehicleId != value)
                {
                    _vehicleId = value;
                }
            }
        }

        [DataMember]
        public Node Location
        {
            get
            {
                return _location;
            }

            set
            {
                if (_location != value)
                {
                    _location = value;
                }
            }
        }

        [DataMember]
        public VehicleType Type
        {
            get
            {
                return _type;
            }

            set
            {
                if (_type != value)
                {
                    _type = value;
                }
            }
        }
    }
}
